<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">
    var string = '1-2-3-4';
    console.log(string.split('-')); // 可以把字符串按照指定的分隔符转换为数组

</script>

</html>
